<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    var user = {
        name: "qinjiang",
        age: 3,
        sex: "男"
    }

    //对象转化为json字符串{"name": "qinjiang","age": 3,"sex": "男"}
    var jsonUser = JSON.stringify(user);

    //json字符串转化为对象 参数为json字符串
    var obj = JSON.parse('{"name": "qinjiang","age": 3,"sex": "男"}')

</script>


</body>
</html>